﻿using System;
using System.Collections.Generic;
using Sinacor.Servico.Bovespa.Contabil.BusinessEntity;
using Sinacor.Servico.Bovespa.Contabil.Service.DataContract.Request;

namespace Sinacor.Servico.Bovespa.Contabil.Service.ServiceImplementation.Translator.BusinessEntityToDataContract
{
    /// <summary>
    /// FGualberto.7COMm - Task 6312
    /// </summary>
    public class HistoricoContabil
    {
        /// <summary>
        /// Para Histórico contabil Response - Unitário
        /// </summary>
        /// <param name="from">HistoricoContabil</param>
        /// <returns>HistoricoContabilResponse</returns>
        public DataContract.Response.HistoricoContabilResponse ToHistoricoContabilResponse(BusinessEntity.HistoricoContabil from)
        {
            DataContract.Response.HistoricoContabilResponse to = new DataContract.Response.HistoricoContabilResponse();
            to.Codigo = from.Codigo;
            to.Digito = from.Digito;
            to.Descricao = from.Descricao;
            return to;
        }

        /// <summary>
        /// Para Histórico contabil Response - Coleção
        /// </summary>
        /// <param name="from">HistoricoContabil</param>
        /// <returns>HistoricoContabilResponse</returns>
        public List<DataContract.Response.HistoricoContabilResponse> ToHistoricoContabilResponse(List<BusinessEntity.HistoricoContabil> from)
        {
            List<DataContract.Response.HistoricoContabilResponse> to = new List<DataContract.Response.HistoricoContabilResponse>();
            foreach (BusinessEntity.HistoricoContabil corr in from)
            {
                to.Add(ToHistoricoContabilResponse(corr));
            }
            return to;
        }

    }
}
